{template header}

<!--{if $webglobal[mode]=='imageadd'}-->
	{templatecss swfupload}
	<script type="text/javascript" src="{WEBURLPATH}/javascript/calendar/WdatePicker.js"></script>
	<script type="text/javascript" charset="utf-8" src="{WEBURLPATH}/editor/kindeditor-min.js"></script>
	<script type="text/javascript" charset="utf-8" src="{WEBURLPATH}/javascript/handlers.js"></script>
	<script type="text/javascript" charset="utf-8" src="{WEBURLPATH}/javascript/album.js"></script>
	<script type="text/javascript" charset="utf-8" src="{WEBURLPATH}/images/swfupload/swfupload.js"></script>

	<script language="javascript">
		var swfu = null;
		var vcc = 0;
		function LoadTestDiv()
		{
			var posLeft = 100; var posTop = 100;
			var newobj = getObj('_myhtml');
			getObj('imagebody').value = getObj('copyhtml').innerHTML;
			var dfstr = '粘贴到这里...';
			if(getObj('imagebody').value.length <= dfstr.length)
			{
				alert('您还没有粘贴任何东西都编辑框哦！');
				return;
			}
			if(!newobj){
				newobj = document.createElement("DIV");
				newobj.id = '_myhtml';
				newobj.style.position='absolute';
				newobj.className = "dlg2";
				newobj.style.top = posTop;
				newobj.style.left = posLeft;
				document.body.appendChild(newobj);
			}
			else{
				newobj.style.display = "block";
			}
			var myajax = new DedeAjax(newobj,false,true,'-','-','...');
			var v = getObj('imagebody').value;
			vcc++;
			<!--{if (strtolower(substr('utf-8', 0, 3)) == 'utf')}-->
			
				//utf8
				myajax.AddKeyUtf8('myhtml',v);
				myajax.AddKeyUtf8('vcc',vcc);
				myajax.SendPost2('album_testhtml.php');

			<!--{elseif (strtolower(substr('gbk', 0, 2)) == 'gb')}-->
				//gbk
				myajax.SendGet2("album_testhtml.php?vcc="+vcc+"&myhtml="+v);
			<!--{/if}-->
			DedeXHTTP = null;
		}

		window.onload = function ()
		{
					swfu = new SWFUpload(
					{
						// Backend Settings
						upload_url: "{WEBURLPATH}/editor/swfupload.php",
						post_params: {"PHPSESSID": "<!--{echo session_id(); }-->", "action" : "upload"},

						// File Upload Settings
						file_size_limit : "2 MB",	// 2MB
						file_types : "*.jpg; *.gif; *.png",
						file_types_description : "选择 JPEG/GIF/PNG 格式图片",
						file_upload_limit : "0",

						file_queue_error_handler : fileQueueError,
						file_dialog_complete_handler : fileDialogComplete,
						upload_progress_handler : uploadProgress,
						upload_error_handler : uploadError,
						upload_success_handler : uploadSuccess,
						upload_complete_handler : uploadComplete,

						button_image_url : "{WEBURLPATH}/images/SmallSpyGlassWithTransperancy_17x18.png",
						button_placeholder_id : "spanButtonPlaceholder",
						button_width: 250,
						button_height: 18,
						button_text : '<span class="button">选择本地图片 <span class="buttonSmall">(单图最大为 2 MB，支持多选)</span></span>',
						button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 10pt; }',
						button_text_top_padding: 0,
						button_text_left_padding: 18,
						button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
						button_cursor: SWFUpload.CURSOR.HAND,
						
						// Flash Settings
						flash_url : "{WEBURLPATH}/images/swfupload/swfupload.swf",

						custom_settings : {
							upload_target : "divFileProgressContainer"
						},
						
						// Debug Settings
						debug: false
					});
		};
		</script>
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>{$webglobal['file_news']['rootCategory']['name']}管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=content&root={$webrequest['root']}">[{$webglobal['file_news']['rootCategory']['name']}列表]</a>
			</td></tr>
		</tbody>
	</table>

	<form name="form1" id="form1" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=imageadd&check" enctype="multipart/form-data">
	<input type="hidden" name="root" value="{$webrequest['root']}" />
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">添加{$webglobal['file_news']['rootCategory']['name']} - 图集</td></tr>
		</thead>
		<tbody>
			{if $webrequest['root'] == 5}
			<tr>
				<th>所属品牌<span class="need"> *</span></th>
				<td>
					<select name="brand_id">
					<option value="0">所属品牌...</option>
					{loop $webglobal['file_news']['brandinfo'] $brand}
					<option value="{$brand[id]}">{$brand[name]}</option>
					{/loop}
					</select>
				</td>
			</tr>
			{/if}
			<tr>
				<th>文章标题<span class="need"> *</span></th>
				<td>
					<input type="text" id="title" style="width:300px" name="title" value="" />
					简略标题:
					<input type="text" style="width:150px" name="shorttitle" value="" />
				</td>
			</tr>
			<tr>
				<th>自定义属性</th>
				<td>
					<input type='checkbox' name='flags[]' value='h'>头条
					<input type='checkbox' name='flags[]' value='c'>推荐
					<input type='checkbox' name='flags[]' value='f'>幻灯
					<input type='checkbox' name='flags[]' value='p'>图片
					<input type='checkbox' name='flags[]' value='a'>特别推荐
				</td>
			</tr>
			<tr>
				<th>缩略图</th>
				<td>
					<input name="picname" type="text" id="picname" style="width:240px" />
					<input type="button"  value="本地上传" style="width:70px;cursor:pointer;" />
					<iframe name='uplitpicfra' id='uplitpicfra' src='' style='display:none'></iframe>
					<span class="litpic_span">
					<input name="litpic" type="file" id="litpic"  onChange="SeePicNew(this, 'divpicview', 'uplitpicfra', 165, '{ADMIN_WEBURLPATH}/index.php?mode=contentadd&check');" size="1" class='np coolbg'/>
					</span>
					<!-- <input type="button" name="Submit2" value="裁剪" style="margin-left:8px;" onClick="imageCut('picname');" class='np coolbg'/> -->
					<div id='divpicview' class='divpre'></div>
				</td>
			</tr>
			<tr>
				<th>图集主栏目<span class="need"> *</span></th>
				<td>
					<select name="news_category_id">
						<option value="0">请选择栏目...</option>
						<!--{loop $webglobal[file_news][class] $categoryID $option}-->
						<option value="{$categoryID}" class="{$option['class']}">{$option[showName]}</option>
						<!--{/loop}-->
					</select>
				</td>
			</tr>
			<tr>
				<th>手工上传</th>
				<td>
					<div style="border: solid 1px #7FAAFF; background-color: #C5D9FF; padding: 2px;width:250px">
						<span id="spanButtonPlaceholder"></span>
					</div>
				</td>
			</tr>
			<tr id="handfield">
				<td colspan="2" class="bline" style="background:url(images/albviewbg.gif) #fff 0 20px no-repeat;height:190px">
				<div id="divFileProgressContainer" style="height:50px;"></div>
				<div id="thumbnails"></div>
				<!-- <table width='100%' height='160px' style="margin:0 0 20px 0">
					<tr><td>111
							<div id="divFileProgressContainer" style="height:75px;"></div>
							<div id="thumbnails"></div>
					</td></tr>
				</table> -->
				</td>
			</tr>
			<tr>
				<th>图集内容<span class="need"> *</span></th>
				<td>
					<script>
						KE.show({
							id : 'content',
							items : ['source', '|', 'undo', 'redo', 'cut', 'copy', 'paste',
									'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
									'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
									'superscript', '|', 'selectall', 'fullscreen', '-',
									'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',
									'italic', 'underline', 'strikethrough', 'removeformat', '|', 'image',
									'flash', 'media', 'advtable', '|', 'link', 'unlink', '|', 'pagebreak'],
							imageUploadJson : '{WEBURLPATH}/editor/editorup.php?upfrom=news',
							resizeMode : 1
						});
					</script>
					<textarea id="content" name="content" style="width:100%;height:500px;"></textarea>
				</td>
			</tr>
		</tbody>
	</table>
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">高级参数</td></tr>
		</thead>
		<tbody>
			<tr>
				<td width="90px">浏览次数</td>
				<td width="150px">
					<input type="text" style="width:100px;" value="94" name="click">
				</td>
				<td width="90px">标题颜色</td>
				<td>
					<input name="color" type="text" id="color" style="width:120px">
					<input name="modcolor" type="button" id="modcolor" value="选取" onClick="ShowColor(event,this)">
				</td>
			</tr>
			<tr>
				<td>图集来源</td>
				<td><input type="text" name="from" size="50" value="" /></td>
				<td>图集作者:</td>
				<td><input type="text" name="writer" size="50" value="" /></td>
			</tr>
			<tr>
				<td>阅读权限</td>
				<td>
					<select name="arcrank">
					<!--{loop $webglobal['file_news']['arcrank'] $rankkey $rankvalue}-->
					<option value="{$rankkey}">{$rankvalue}</option>
					<!--{/loop}-->
					</select>
				</td>
				<td>发布时间</td>
				<td>
					<input type="text" class="Wdate" name="showtime" style="width:138px" value="{$webglobal['file_news']['nowtime']}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
				</td>
			</tr>
			<tr>
				<td>文章排序</td>
				<td>
					<select name="sortup" id="sortup" style="width:150">
						<option value="0" selected>默认排序</option>
						<option value="7">置顶一周</option>
						<option value="30">置顶一个月</option>
						<option value="90">置顶三个月</option>
						<option value="180">置顶半年</option>
						<option value="360">置顶一年</option>
					</select>
				</td>
				<td>关键字</td>
				<td colspan="3"><input type="text" name="keywords" size="50" value="" /></td>
			</tr>
			<tr>
				<td>内容摘要</td>
				<td colspan="3">
					<textarea style="width:449px;height:50px" id="description" rows="5" name="description"></textarea>
				</td>
			</tr>
		</tbody>
		<tfoot>
			<tr><td colspan="4">
				<input type="submit" name="adminsubmit" class="submitok" value=" 确  认 " />&nbsp;&nbsp;
				<input type="reset" name="adminreset" value=" 取  消 " />
			</td></tr>
		</tfoot>
	</table>
	</form>

<!--{elseif $webglobal[mode]=='imageedit'}-->
	{templatecss swfupload}
	<script type="text/javascript" src="{WEBURLPATH}/javascript/calendar/WdatePicker.js"></script>
	<script type="text/javascript" charset="utf-8" src="{WEBURLPATH}/editor/kindeditor-min.js"></script>
	<script type="text/javascript" charset="utf-8" src="{WEBURLPATH}/javascript/handlers.js"></script>
	<script type="text/javascript" charset="utf-8" src="{WEBURLPATH}/javascript/album.js"></script>
	<script type="text/javascript" charset="utf-8" src="{WEBURLPATH}/images/swfupload/swfupload.js"></script>

	<script language="javascript">
		var swfu = null;
		var vcc = 0;
		window.onload = function ()
		{
			swfu = new SWFUpload(
			{
				// Backend Settings
				upload_url: "{WEBURLPATH}/editor/swfupload.php",
				post_params: {"PHPSESSID": "<!--{echo session_id(); }-->", "action" : "upload"},

				// File Upload Settings
				file_size_limit : "2 MB",	// 2MB
				file_types : "*.jpg; *.gif; *.png",
				file_types_description : "选择 JPEG/GIF/PNG 格式图片",
				file_upload_limit : "0",

				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,

				button_image_url : "{WEBURLPATH}/images/SmallSpyGlassWithTransperancy_17x18.png",
				button_placeholder_id : "spanButtonPlaceholder",
				button_width: 250,
				button_height: 18,
				button_text : '<span class="button">选择本地图片 <span class="buttonSmall">(单图最大为 2 MB，支持多选)</span></span>',
				button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 10pt; }',
				button_text_top_padding: 0,
				button_text_left_padding: 18,
				button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
				button_cursor: SWFUpload.CURSOR.HAND,
				
				// Flash Settings
				flash_url : "{WEBURLPATH}/images/swfupload/swfupload.swf",

				custom_settings : {
					upload_target : "divFileProgressContainer"
				},
				
				// Debug Settings
				debug: false
			});
		};
	</script>
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>图集管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=content&{$webglobal['file_news']['gourl']}">[返回列表]</a>
			</td></tr>
		</tbody>
	</table>

	<form name="form1" id="form1" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=imageedit&check" enctype="multipart/form-data">
	<input type="hidden" name="editid" value="{$webrequest['editid']}" />
	<input type="hidden" name="gourl" value="{$webglobal['file_news']['gourl']}" />
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">修改图集</td></tr>
		</thead>
		<tbody>
			{if $webrequest['root'] == 5}
			<tr>
				<th>所属品牌<span class="need"> *</span></th>
				<td>
					<select name="brand_id">
					<option value="0">所属品牌...</option>
					{loop $webglobal['file_news']['brandinfo'] $brand}
					<option value="{$brand[id]}"{if $webglobal['file_news']['editinfo']['brand_id'] == $brand[id]} selected{/if}>{$brand[name]}</option>
					{/loop}
					</select>
				</td>
			</tr>
			{/if}
			<tr>
				<th>文章标题<span class="need"> *</span></th>
				<td>
					<input type="text" id="title" style="width:300px" name="title" value="{$webglobal['file_news']['editinfo']['title']}" />
					简略标题:
					<input type="text" style="width:150px" name="shorttitle" value="{$webglobal['file_news']['editinfo']['shorttitle']}" />
				</td>
			</tr>
			<tr>
				<th>自定义属性</th>
				<td>
					<input type='checkbox' name='flags[]' value='h'{if global_CheckHaveVar($webglobal['file_news']['editinfo']['flag'], 'h')} checked{/if}>头条
					<input type='checkbox' name='flags[]' value='c'{if global_CheckHaveVar($webglobal['file_news']['editinfo']['flag'], 'c')} checked{/if}>推荐
					<input type='checkbox' name='flags[]' value='f'{if global_CheckHaveVar($webglobal['file_news']['editinfo']['flag'], 'f')} checked{/if}>幻灯
					<input type='checkbox' name='flags[]' value='p'{if global_CheckHaveVar($webglobal['file_news']['editinfo']['flag'], 'p')} checked{/if}>图片
					<input type='checkbox' name='flags[]' value='a'{if global_CheckHaveVar($webglobal['file_news']['editinfo']['flag'], 'a')} checked{/if}>特别推荐
				</td>
			</tr>
			<tr>
				<th>缩略图</th>
				<td>
					<input name="picname" type="text" id="picname" value="{$webglobal['file_news']['editinfo']['litpic']}" style="width:240px" />
					<input type="button"  value="本地上传" style="width:70px;cursor:pointer;" />
					<iframe name='uplitpicfra' id='uplitpicfra' src='' style='display:none'></iframe>
					<span class="litpic_span">
					<input name="litpic" type="file" id="litpic"  onChange="SeePicNew(this, 'divpicview', 'uplitpicfra', 165, '{ADMIN_WEBURLPATH}/index.php?mode=imageedit&check');" size="1" class='np coolbg'/>
					</span>
					<!-- <input type="button" name="Submit2" value="裁剪" style="margin-left:8px;" onClick="imageCut('picname');" class='np coolbg'/> -->
					<div id='divpicview' class='divpre'></div>
				</td>
			</tr>
			<tr>
				<th>图集主栏目<span class="need"> *</span></th>
				<td>
					<select name="news_category_id">
						<option value="0">请选择栏目...</option>
						<!--{loop $webglobal[file_news][class] $categoryID $option}-->
						<option value="{$categoryID}" class="{$option['class']}"{if $webglobal['file_news']['editinfo']['news_category_id'] == $categoryID} selected{/if}>{$option[showName]}</option>
						<!--{/loop}-->
					</select>
				</td>
			</tr>
			<tr>
				<th>原有图片</th>
				<td>
					<div id="thumbnailsEdit">
					{loop $webglobal['file_news']['editinfo']['imagevalue'] $key $image}
					<div id="albold{$key}" class="albCt albEdit">
						<input type="hidden" id="filepath_{$key}" name="filepath[{$key}]" value="{$image['src']}" />
						<img width="120" src="{WEBURLPATH}/editor/swfupload.php?action=thumbnail&file={echo urlencode($image['src'])}"><a href="javascript:delAlbPicOld('{$key}')">[删除]</a>
						<div style="margin-top:10px">注释：<input type="text" style="width:150px;" value="{$image['info']}" name="picinfo[{$key}]"></div>
					</div>
					{/loop}
					</div>
					<script language="javascript">
					albImg = {echo count($webglobal['file_news']['editinfo']['imagevalue'])};
					</script>
				</td>
			</tr>
			<tr>
				<th>增加新图片</th>
				<td>
					<div style="border: solid 1px #7FAAFF; background-color: #C5D9FF; padding: 2px;width:250px">
						<span id="spanButtonPlaceholder"></span>
					</div>
				</td>
			</tr>
			<tr id="handfield">
				<td colspan="2" class="bline" style="background:url(images/albviewbg.gif) #fff 0 20px no-repeat;height:190px">
				<div id="divFileProgressContainer" style="height:50px;"></div>
				<div id="thumbnails"></div>
				<!-- <table width='100%' height='160px' style="margin:0 0 20px 0">
					<tr><td>111
							<div id="divFileProgressContainer" style="height:75px;"></div>
							<div id="thumbnails"></div>
					</td></tr>
				</table> -->
				</td>
			</tr>
			<tr>
				<th>图集内容<span class="need"> *</span></th>
				<td>
					<script>
						KE.show({
							id : 'content',
							items : ['source', '|', 'undo', 'redo', 'cut', 'copy', 'paste',
									'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
									'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
									'superscript', '|', 'selectall', 'fullscreen', '-',
									'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',
									'italic', 'underline', 'strikethrough', 'removeformat', '|', 'image',
									'flash', 'media', 'advtable', '|', 'link', 'unlink', '|', 'pagebreak'],
							imageUploadJson : '{WEBURLPATH}/editor/editorup.php?upfrom=news',
							resizeMode : 1
						});
					</script>
					<textarea id="content" name="content" style="width:100%;height:500px;">{$webglobal['file_news']['editinfo']['content']}</textarea>
				</td>
			</tr>
		</tbody>
	</table>

	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">高级参数</td></tr>
		</thead>
		<tbody>
			<tr>
				<td width="90px">浏览次数</td>
				<td width="150px">
					<input type="text" style="width:100px;" value="{$webglobal['file_news']['editinfo']['click']}" name="click">
				</td>
				<td width="90px">标题颜色</td>
				<td>
					<input name="color" type="text" value="{$webglobal['file_news']['editinfo']['color']}" id="color" style="width:120px">
					<input name="modcolor" type="button" id="modcolor" value="选取" onClick="ShowColor(event,this)">
				</td>
			</tr>
			<tr>
				<td>图集来源</td>
				<td><input type="text" name="from" size="50" value="{$webglobal['file_news']['editinfo']['from']}" /></td>
				<td>图集作者:</td>
				<td><input type="text" name="writer" size="50" value="{$webglobal['file_news']['editinfo']['writer']}" /></td>
			</tr>
			<tr>
				<td>阅读权限</td>
				<td>
					<select name="arcrank">
					<!--{loop $webglobal['file_news']['arcrank'] $rankkey $rankvalue}-->
					<option value="{$rankkey}"{if $webglobal['file_news']['editinfo']['arcrank'] == $rankkey} selected{/if}>{$rankvalue}</option>
					<!--{/loop}-->
					</select>
				</td>
				<td>发布时间</td>
				<td>
					<input type="text" class="Wdate" name="showtime" style="width:138px" value="{$webglobal['file_news']['editinfo']['showtime_show']}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
				</td>
			</tr>
			<tr>
				<td>文章排序</td>
				<td>
					<select name="sortup" id="sortup" style="width:150">
						<option value="0"{if $webglobal['file_news']['editinfo']['sortup'] == 0} selected{/if}>默认排序</option>
						<option value="7"{if $webglobal['file_news']['editinfo']['sortup'] == 7} selected{/if}>置顶一周</option>
						<option value="30"{if $webglobal['file_news']['editinfo']['sortup'] == 30} selected{/if}>置顶一个月</option>
						<option value="90"{if $webglobal['file_news']['editinfo']['sortup'] == 90} selected{/if}>置顶三个月</option>
						<option value="180"{if $webglobal['file_news']['editinfo']['sortup'] == 180} selected{/if}>置顶半年</option>
						<option value="360"{if $webglobal['file_news']['editinfo']['sortup'] == 360} selected{/if}>置顶一年</option>
					</select>
				</td>
				<td>关键字</td>
				<td colspan="3"><input type="text" name="keywords" size="50" value="{$webglobal['file_news']['editinfo']['keywords']}" /></td>
			</tr>
			<tr>
				<td>内容摘要</td>
				<td colspan="3">
					<textarea style="width:449px;height:50px" id="description" rows="5" name="description">{$webglobal['file_news']['editinfo']['description']}</textarea>
				</td>
			</tr>
		</tbody>
		<tfoot>
			<tr><td colspan="4">
				<input type="submit" name="adminsubmit" class="submitok" value=" 确  认 " />&nbsp;&nbsp;
				<input type="reset" name="adminreset" value=" 取  消 " />
			</td></tr>
		</tfoot>
	</table>
	</form>
<!--{/if}-->

{template footer}